package com.deli.pagingforjava.adapter;

import android.view.LayoutInflater;

import androidx.paging.LoadStateAdapter;
import androidx.recyclerview.widget.RecyclerView;

/**
 * 加载更多
 *
 * @Author: QDL
 * @CreateDate: 2021/4/25 13:44
 */
public abstract class BaseFooterAdapter<VH extends RecyclerView.ViewHolder> extends LoadStateAdapter<VH> {
    OnFooterViewListener listener;

    LayoutInflater layoutInflater;

    public BaseFooterAdapter(LayoutInflater layoutInflater) {
        this.layoutInflater = layoutInflater;
    }

    /**
     * 注册监听
     *
     * @param listener
     */
    public BaseFooterAdapter<VH> setOnFooterViewListener(OnFooterViewListener listener) {
        this.listener = listener;
        return this;
    }

    public interface OnFooterViewListener {
        /**
         * 重试
         */
        public abstract void onRetry();
    }
}
